package models;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
@Table(name="user_table")
public class User extends Model {
	
	public String username;
    public String email;
    public String password;
    public String fullname;
    public Role role;
    public String description;
    
	/**
	 * @param email
	 * @param password
	 * @param fullname
	 * @param role
	 * @param description
	 */
	public User(String username, String email, String password, String fullname, Role role, String description) {
		super();
		this.username = username;
		this.email = email;
		this.password = password;
		this.fullname = fullname;
		this.role = role;
		this.description = description;
	}

	public static User findByUsernamePass(String username, String password) {
		return find("byUsernameAndPassword", username, password).first();
	}
    
}
